/**
 * File TestState.java 
 */
package cstest.model;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import cs.model.State;
import cs.model.State.LocalUserState;

/**
 * Package  cstest.model
 * Project ChatSystemG1 - INSA 4INFOA1 - 2013/2014
 * @author Julie DUMONS & Juste OUEDRAOGO
 *
 */
public class TestState {
	State s1, s2 ; 
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		s2 = new State();

	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
		
	}

	/**
	 * Test method for {@link cs.model.State#State()}.
	 */
	@Test
	public void testState() {
		assertNull(s1);
		s1 = new State();
		assertNotNull(s1);
		assertSame(s1.getCurrentState(), LocalUserState.OFFLINE);
	}

	/**
	 * Test method for {@link cs.model.State#getCurrentState()}.
	 */
	@Test
	public void testGetCurrentState() {
		assertSame(s2.getCurrentState(), LocalUserState.OFFLINE); 
		
	}

	/**
	 * Test method for {@link cs.model.State#setcurrentState(cs.model.State.LocalUserState)}.
	 */
	@Test
	public void testSetcurrentState() {
		assertSame(s2.getCurrentState(), LocalUserState.OFFLINE); 
		s2.setcurrentState(LocalUserState.ONLINE);
		assertSame(s2.getCurrentState(), LocalUserState.ONLINE); 

	}

}
